import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['svg.fonttype'] = 'none'

# 创建数据框架
data = {
    'Node Nums': [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
    'SPS': [0.352272584,0.308028131,0.211540771,0.149373358,0.076065662,0.19932659,0.172432019,0.108564908,0.116591451,0.19155996,0.090963946],
    'OGS': [0.595006798,0.296982499,0.263650855,0.261914618,0.233173503,0.277632466,0.332013938,0.255779994,0.224247942,0.30412982,0.254517037],
    'ORDP': [0.420682518,0.389387912,0.277802145,0.295292162,0.263955605,0.23177714,0.204489485,0.174755588,0.215667702,0.240740692,0.330128546],
}

df = pd.DataFrame(data)

# 绘制数据
plt.figure(figsize=(8, 6))
plt.plot(df['Node Nums'], df['SPS'], marker='s', markersize=10, label='SPS')
plt.plot(df['Node Nums'], df['OGS'], marker='^', markersize=10, label='OGS')
plt.plot(df['Node Nums'], df['ORDP'], marker='*', markersize=10, label='ORDP')

# plt.title('Comparison of SPF and Cplex Algorithms')
plt.xlabel('Number of Nodes', fontsize=14)
plt.ylabel('Resource Utilization (%)', fontsize=14)
plt.legend(fontsize='large')  # 设置图例的字体大小为大

plt.grid(True)
# plt.show()
plt.savefig("plot_incluster_ru.svg", format="svg")
